﻿Imports System
Imports System.IO
Imports System.Data
Imports System.Data.SqlServerCe
Imports System.Drawing
Imports System.Collections
Imports System.Windows.Forms
Imports System.Data.Common

Module WeldMachine

    Public Function findWeldMachines(ByVal projectId As String, ByVal serialNumber As String) As DataTable
        Dim dtResult As New DataTable
        Dim paramList As New Hashtable()

        Dim SQL As String = "SELECT * FROM eqam_weld_machine WHERE 1=1 "

        If (projectId IsNot Nothing And projectId <> "") Then
            SQL = SQL & " AND PROJECT_ID = @PROJECT_ID"
            paramList.Add("@PROJECT_ID", projectId)
        End If

        If (serialNumber IsNot Nothing And serialNumber <> "") Then
            SQL = SQL & " AND SERIAL_NUMBER = @SERIAL_NUMBER"
            paramList.Add("@SERIAL_NUMBER", serialNumber)
        End If

        SQL = SQL & " ORDER BY SERIAL_NUMBER "

        Return LoadData(SQL, paramList)
    End Function
End Module
